import React from 'react';
import styled from 'styled-components';

interface DecorativeTitleProps {
  title: string;
  children?: React.ReactNode;
}

const Wrapper = styled.div`
  position: relative;
  width: 100%;
`;

const TitleContainer = styled.div`
  position: relative;
  padding: 8px 15px;
  background: linear-gradient(90deg, 
    rgba(0, 48, 135, 0.3) 0%,
    rgba(0, 48, 135, 0.1) 100%
  );
  color: #fff;
  font-size: 14px;

  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #0088ff;
  }

  &::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(90deg,
      rgba(0, 136, 255, 0.5) 0%,
      rgba(0, 136, 255, 0) 100%
    );
  }
`;

const ContentContainer = styled.div`
  position: relative;
  margin-top: 2px;
  padding: 15px;
  background: rgba(0, 24, 65, 0.5);
  border: 1px solid rgba(0, 136, 255, 0.2);
  color: #fff;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    border-top: 1px solid rgba(0, 136, 255, 0.6);
    border-left: 1px solid rgba(0, 136, 255, 0.6);
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 6px;
    border-top: 1px solid rgba(0, 136, 255, 0.6);
    border-right: 1px solid rgba(0, 136, 255, 0.6);
  }
`;

const BottomCorners = styled.div`
  &::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 6px;
    height: 6px;
    border-bottom: 1px solid rgba(0, 136, 255, 0.6);
    border-left: 1px solid rgba(0, 136, 255, 0.6);
  }

  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 6px;
    height: 6px;
    border-bottom: 1px solid rgba(0, 136, 255, 0.6);
    border-right: 1px solid rgba(0, 136, 255, 0.6);
  }
`;

const DecorativeTitle: React.FC<DecorativeTitleProps> = ({ title, children }) => {
  return (
    <Wrapper>
      <TitleContainer>{title}</TitleContainer>
      <ContentContainer>
        {children}
        <BottomCorners />
      </ContentContainer>
    </Wrapper>
  );
};

export default DecorativeTitle; 